package digui;

import java.io.File;

public class RecursinTest2 {


static     String [] ss= {" ","  ","   ","    ","     ","        "};
    public  static  void main(String [] args){
        recursin("./");
    }

    public static  void recursin(String path) {
        File file = new File(path);
        File [] files = file.listFiles();
        if(file.isDirectory()&&files.length == 0){
            System.out.println("我是目录"+file.getName()+"我是空的");
            return;
        }
        for(int i=0;i<files.length;i++){
            if(files[i].isDirectory()){
                System.out.println(ss[i]+"我是目录"+files[i]);
                recursin(files[i].getAbsolutePath());
            }else{
                System.out.println("我是文件"+files[i]);
            }
        }
    }

}
